package converter

import "strconv"

func Str2Int(val string) int {
	res, err := strconv.Atoi(val)
	if err != nil {
		return 0
	}
	return res
}

func Str2Int64(val string) int64 {
	res, err := strconv.Atoi(val)
	if err != nil {
		return 0
	}
	return int64(res)
}

func Str2Float64(val string) float64 {
	res, err := strconv.ParseFloat(val, 10)
	if err != nil {
		return 0.00
	}
	return res
}

func Str2Float32(val string) float32 {
	res, err := strconv.ParseFloat(val, 10)
	if err != nil {
		return 0.00
	}
	return float32(res)
}
